package com.ybkj.daijia.server.service;

import com.ybkj.daijia.common.Result;
import com.ybkj.daijia.page.Page;
import com.ybkj.daijia.server.sales.Activity.OrderType;
import com.ybkj.daijia.server.sales.Coupon;
import com.ybkj.daijia.server.sales.CouponRule.CouponType;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author Shine
 */
public interface CouponService {

    public List<Coupon> findAll(Long ruleId);

    public Page<Coupon> queryByPassenger(Long passengerId, Integer page, Integer limit,
        Integer status);

    public BigDecimal sumMoneyByPassenger(Long passengerId);

    public List<Coupon> listByPassenger(Long passengerId, CouponType couponType, Long couponTypeId,
        String linesId);

    public Coupon findByCode(String code);

    /**
     * 根据id生成优惠券
     *
     * @param couponRuleId
     * @param amount
     * @return
     */
    public void listMass(Long couponRuleId, Integer amount);
//	public void listMass(Long couponRuleId, String param);

    /**
     * 根据优惠券规则id、类型、编码、电话查询优惠券
     *
     * @param ruleId
     * @param
     * @param
     * @param phone
     * @return
     */
    public Page<Coupon> queryCoupon(Long ruleId, String code, String phone);

    /**
     * 失效优惠券
     *
     * @param id
     * @return
     */
    public Result<Coupon> updateCouponLapsed(Long id);

    public Coupon findOne(Long id);

    public Result<Coupon> update(Coupon coupon);


    /**
     * 手动赠送优惠券
     *
     * @param passengerId
     * @param couponRuleId
     * @param couponType
     * @param amount
     */
    public Result<Coupon> giftCoupon(String content, String carNumber, String name,
        String phone, Long[] companyIds, String startTime, String endTime,
        Long[] gradeIds, Integer[] type, Boolean[] allowOverdraw, Integer overDay,
        OrderType orderType,
        String sendTypes, String couponRuleId, String amount);

    /**
     * 根据规则查询所有 导入旧数据用
     *
     * @return
     */
    public List<com.ybkj.daijia.server.model.Coupon> listAllOldByRule(Long ruleId);

    /**
     * 保存优惠券 导入旧数据用
     *
     * @return
     */
    public Result<Coupon> insert(Long memberId, String phone, Long couponRuleId,
        Integer status, String code, Long runCode, String codeKey);


}
